#ifndef _NH_SPO2_H_
#define _NH_SPO2_H_


/**
 * @file nh_spo2.h
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2024-04-10
 * 
 * @copyright Copyright (c) 2024
 * 
 */

#include "stdio.h"
#include "stdlib.h"
#include "stdint.h"


#define SAMPLE_FREQ_SPO2 50

typedef struct 
{
    int16_t     hr; 
    float       spo2;   
}spo2_result_t;


/**
 * @brief Get the spo2 algorithm version string 
 * 
 * @return char* 
 */
char *get_spo2_algorithm_version(void);

/**
 * @brief init data 
 * 
 * @param sample_freq_Hz 
 */
void spo2_init(void);

/**
 * @brief 
 * 
 * @param red 
 * @param ir 
 */
void spo2_input(int32_t red,int32_t ir);

/**
 * @brief get result
 * 
 * @return spo2_result_t 
 */
spo2_result_t output_spo2_result(void);


/**
 * @brief Get the spo2 r val 
 *        only use Debug
 * @return double 
 */
float get_spo2_r_val(void);

#endif

